/**
* @file touch.h
* @author cyril
* @time 2021/9/2
*/
#ifndef __TOUCH_H__
#define __TOUCH_H__

#ifdef __cplusplus
extern "C" {
#endif
/*********************
*      INCLUDES
*********************/
#include "main.h"
#include "st7735.h"
#include "ns2009.h"

/*********************
*      DEFINES
*********************/

/**********************
*      MACROS
**********************/

/**********************
*      TYPEDEFS
**********************/
typedef enum{
    TOUCHSCREEN_STATUS_IDLE =0,
    TOUCHSCREEN_STATUS_RELEASE,
    TOUCHSCREEN_STATUS_PRESS,
    TOUCHSCREEN_STATUS_MOVE
} touchscreen_type_t;

/**********************
*  GLOBAL PROTOTYPES
**********************/
void Touch_Init(void);
void Touch_Calibrate(void);
int Touch_ReadAll(void);
int Touch_Read_X(void);
int Touch_Read_Y(void);
touchscreen_type_t Touch_GetStatus(void);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif






